package com.lkm.app_ui.help;



public class PrinterUtil {
    private static volatile DevicePrinter printer = null;
    private static String tailed = "";

    public static String getTailed() {
        return tailed;
    }

    public static void setTailed(String tailed) {
        tailed = tailed;
    }

    public static DevicePrinter getSingleton() {
        if (printer == null) {
            synchronized (DevicePrinter.class) {
                if (printer == null) {

                    printer = new DevicePrinter("/dev/ttyS1", 115200);

                    

                }
            }
        }
        return printer;
    }

    public static void print(String content) {
        getSingleton().print(new StringBuilder(String.valueOf(content)).append(tailed).toString());
    }

    public static void printQRCode(String strCodedata, int nWidthX, int nVersion, int nErrorCorrectionLevel) {
        getSingleton().printQRCode(strCodedata, nWidthX, nVersion, nErrorCorrectionLevel);
    }

    public static void printQRCode(String strCodedata) {
        printQRCode(strCodedata, 6, 10, 4);
    }
}